home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / winsr173.zip / LOADFILE.C < prev    next >
Text File  |  1992-01-14  |  20KB  |  667 lines

  1. /*
  2.     loadfile.c - load an existing fractal image, control level
  3.     This module is linked as an overlay, use ENTER_OVLY and EXIT_OVLY.
  4. */
  5.  
  6. #include <stdlib.h>
  7. #include <stdio.h>
  8. #include <string.h>
  9. #include "fractint.h"
  10. #include "fractype.h"
  11. #include "targa_lc.h"
  12.  
  13. /* routines in this module    */
  14.  
  15. void loadfile_overlay(void);
  16. int  read_overlay(void);
  17.  
  18. static int  find_fractal_info(char *,struct fractal_info *);
  19. static void load_ext_blk(char far *loadptr,int loadlen);
  20. static void skip_ext_blk(int *,int *);
  21. static void backwardscompat();
  22.  
  23. int filetype;
  24. int loaded3d;
  25.  
  26. extern int    showfile;         /* has file been displayed yet? */
  27. extern char   readname[];        /* name of fractal input file */
  28. extern char   far *resume_info;     /* pointer to resume info if alloc'd */
  29. extern int    resume_len;        /* length of resume info */
  30. extern int    adapter;
  31. extern int    calc_status;
  32. extern int    initmode;         /* initial video mode        */
  33. extern long   calctime;
  34. extern int    initbatch;        /* 1 if batch run (no kbd)  */
  35. extern int    maxit;
  36. extern int    initincr;         /* maxiter incrmnt        */
  37. extern char   usr_stdcalcmode;        /* pass mode            */
  38. extern int    fractype;         /* fractal type         */
  39. extern double xxmin,xxmax;        /* corner values        */
  40. extern double yymin,yymax;        /* corner values        */
  41. extern double xx3rd,yy3rd;        /* corner values        */
  42. extern double param[4];         /* parameters            */
  43. extern int    fillcolor;        /* fill color: -1 = normal  */
  44. extern int    inside;            /* inside color: 1=blue     */
  45. extern int    outside;            /* outside color, if set    */
  46. extern int    finattract;        /* finite attractor option  */
  47. extern int    forcesymmetry;
  48. extern int    LogFlag;            /* non-zero if logarithmic palettes */
  49. extern int    rflag, rseed;
  50. extern int    usr_periodicitycheck;
  51. extern char   useinitorbit;
  52. extern struct complex initorbit;
  53. extern int    potflag;            /* continuous potential flag */
  54. extern int    pot16bit;
  55. extern double potparam[3];        /* three potential parameters*/
  56. extern double inversion[];
  57. extern int    decomp[];
  58. extern int    usr_distest;        /* non-zero if distance estimator   */
  59. extern int    distestwidth;
  60. extern int    init3d[20];        /* '3d=nn/nn/nn/...' values */
  61. extern char   usr_floatflag;        /* floating-point fractals? */
  62. extern char   floatflag;
  63. extern int    usr_biomorph;
  64. extern char   FormName[];
  65. extern char   LName[];
  66. extern char   IFSName[];
  67. extern int    bailout;            /* user input bailout value */
  68. extern int    previewfactor;
  69. extern int    xtrans;
  70. extern int    ytrans;
  71. extern int    red_crop_left;
  72. extern int    red_crop_right;
  73. extern int    blue_crop_left;
  74. extern int    blue_crop_right;
  75. extern int    red_bright;
  76. extern int    blue_bright;
  77. extern int    xadjust;
  78. extern int    eyeseparation;
  79. extern int    glassestype;
  80. extern int    display3d;        /* 3D display flag: 0 = OFF */
  81. extern int    overlay3d;        /* 3D overlay flag: 0 = OFF */
  82. extern int    viewwindow;        /* 0 for full screen, 1 for window */
  83. extern float  viewreduction;        /* window auto-sizing */
  84. extern float  finalaspectratio;     /* for view shape and rotation */
  85. extern int    xdots, ydots;        /* # of dots on the logical screen */
  86. extern int    viewxdots,viewydots;    /* explicit view sizing */
  87. extern int    save_system,save_release;
  88. extern int    Ambient;
  89. extern int    RANDOMIZE;
  90. extern int    haze;
  91. extern int    transparent[2];
  92. extern int    rotate_lo,rotate_hi;
  93. extern int far *ranges;
  94. extern int    rangeslen;
  95. extern int    invert;
  96.  
  97. static FILE *fp;
  98.  
  99. int fileydots, filexdots, filecolors;
  100. float fileaspectratio;
  101.  
  102. int skipxdots,skipydots;    /* for decoder, when reducing image */
  103.  
  104.  
  105. void loadfile_overlay() { }    /* for restore_active_ovly */
  106.  
  107.  
  108. int read_overlay()    /* read overlay/3D files, if reqr'd */
  109. {
  110.    struct fractal_info read_info;
  111.    char oldfloatflag;
  112.    char msg[110];
  113.  
  114.    ENTER_OVLY(OVLY_LOADFILE);
  115.  
  116.    showfile = 1;        /* for any abort exit, pretend done */
  117.    initmode = -1;        /* no viewing mode set yet */
  118.    oldfloatflag = usr_floatflag;
  119.    loaded3d = 0;
  120.  
  121.    if(strchr(readname,'.') == NULL)
  122.       strcat(readname,".gif");
  123.  
  124.    if(find_fractal_info(readname,&read_info)) { /* didn't find a useable file */
  125.       sprintf(msg,"Sorry, %s isn't a file I can decode.",readname);
  126.       stopmsg(0,msg);
  127.       EXIT_OVLY;
  128.       return(-1);
  129.       }
  130.  
  131.    maxit    = read_info.iterations;
  132.    fractype    = read_info.fractal_type;
  133.    curfractalspecific = &fractalspecific[fractype];
  134.    xxmin    = read_info.xmin;
  135.    xxmax    = read_info.xmax;
  136.    yymin    = read_info.ymin;
  137.    yymax    = read_info.ymax;
  138.    param[0]    = read_info.creal;
  139.    param[1]    = read_info.cimag;
  140.    save_release = 1100; /* unless we find out better later on */
  141.  
  142.    invert = 0;
  143.    if(read_info.version > 0) {
  144.       param[2]        = read_info.parm3;
  145.       roundfloatd(¶m[2]);
  146.       param[3]        = read_info.parm4;
  147.       roundfloatd(¶m[3]);
  148.       potparam[0]   = read_info.potential[0];
  149.       potparam[1]   = read_info.potential[1];
  150.       potparam[2]   = read_info.potential[2];
  151.       potflag        = (potparam[0] != 0.0);
  152.       rflag        = read_info.rflag;
  153.       rseed        = read_info.rseed;
  154.       inside        = read_info.inside;
  155.       LogFlag        = read_info.logmap;
  156.       inversion[0]  = read_info.invert[0];
  157.       inversion[1]  = read_info.invert[1];
  158.       inversion[2]  = read_info.invert[2];
  159.       if (inversion[0] != 0.0)
  160.      invert = 3;
  161.       decomp[0]     = read_info.decomp[0];
  162.       decomp[1]     = read_info.decomp[1];
  163.       usr_biomorph  = read_info.biomorph;
  164.       forcesymmetry = read_info.symmetry;
  165.       }
  166.  
  167.    if(read_info.version > 1) {
  168.       save_release  = 1200;
  169.       if (!display3d
  170.     && (read_info.version <= 4 || read_info.flag3d > 0
  171.         || (curfractalspecific->flags&PARMS3D) )) {
  172.      int i;
  173.      for (i = 0; i < 16; i++)
  174.         init3d[i] = read_info.init3d[i];
  175.      previewfactor     = read_info.previewfactor;
  176.      xtrans      = read_info.xtrans;
  177.      ytrans      = read_info.ytrans;
  178.      red_crop_left     = read_info.red_crop_left;
  179.      red_crop_right  = read_info.red_crop_right;
  180.      blue_crop_left  = read_info.blue_crop_left;
  181.      blue_crop_right = read_info.blue_crop_right;
  182.      red_bright     = read_info.red_bright;
  183.      blue_bright     = read_info.blue_bright;
  184.      xadjust     = read_info.xadjust;
  185.      eyeseparation     = read_info.eyeseparation;
  186.      glassestype     = read_info.glassestype;
  187.      }
  188.       }
  189.  
  190.    if(read_info.version > 2) {
  191.       save_release = 1300;
  192.       outside       = read_info.outside;
  193.       }
  194.  
  195.    calc_status = 0;      /* defaults if version < 4 */
  196.    xx3rd = xxmin;
  197.    yy3rd = yymin;
  198.    usr_distest = 0;
  199.    calctime = 0;
  200.    if(read_info.version > 3) {
  201.       save_release = 1400;
  202.       xx3rd      = read_info.x3rd;
  203.       yy3rd      = read_info.y3rd;
  204.       calc_status = read_info.calc_status;
  205.       usr_stdcalcmode = read_info.stdcalcmode;
  206.       usr_distest     = read_info.distest;
  207.       usr_floatflag   = read_info.floatflag;
  208.       bailout      = read_info.bailout;
  209.       calctime      = read_info.calctime;
  210.       trigndx[0]  = read_info.trigndx[0];
  211.       trigndx[1]  = read_info.trigndx[1];
  212.       trigndx[2]  = read_info.trigndx[2];
  213.       trigndx[3]  = read_info.trigndx[3];
  214.       finattract  = read_info.finattract;
  215.       initorbit.x = read_info.initorbit[0];
  216.       initorbit.y = read_info.initorbit[1];
  217.       useinitorbit = read_info.useinitorbit;
  218.       usr_periodicitycheck = read_info.periodicity;
  219.       }
  220.  
  221.    pot16bit = 0;
  222.    save_system = 0;
  223.    if(read_info.version > 4) {
  224.       pot16bit       = read_info.pot16bit;
  225.       if (pot16bit)
  226.      filexdots >>= 1;
  227.       fileaspectratio = read_info.faspectratio;
  228.       if (fileaspectratio < 0.01)    /* fix files produced in early v14.1 */
  229.      fileaspectratio = SCREENASPECT;
  230.       save_system  = read_info.system;
  231.       save_release = read_info.release; /* from fmt 5 on we know real number */
  232.       if (read_info.version == 5    /* except a few early fmt 5 cases: */
  233.       && (save_release <= 0 || save_release >= 2000)) {
  234.      save_release = 1410;
  235.      save_system = 0;
  236.      }
  237.       if (!display3d && read_info.flag3d > 0) {
  238.      loaded3d    = 1;
  239.      Ambient    = read_info.ambient;
  240.      RANDOMIZE    = read_info.randomize;
  241.      haze        = read_info.haze;
  242.      transparent[0] = read_info.transparent[0];
  243.      transparent[1] = read_info.transparent[1];
  244.      }
  245.       }
  246.  
  247.    rotate_lo = 1; rotate_hi = 255;
  248.    distestwidth = 71;
  249.    if(read_info.version > 5) {
  250.       rotate_lo     = read_info.rotate_lo;
  251.       rotate_hi     = read_info.rotate_hi;
  252.       distestwidth    = read_info.distestwidth;
  253.       }
  254.  
  255.    if(read_info.version > 6) {
  256.       param[2]        = read_info.dparm3;
  257.       param[3]        = read_info.dparm4;
  258.       }
  259.  
  260.    if(read_info.version > 7) {
  261.       fillcolor        = read_info.fillcolor;
  262.       }
  263.  
  264.    if(read_info.version < 4) { /* pre-version 14.0? */
  265.       backwardscompat(&read_info); /* translate obsolete types */
  266.       if(LogFlag)
  267.      LogFlag = 2;
  268.       usr_floatflag = (curfractalspecific->isinteger) ? 0 : 1;
  269.       }
  270.  
  271.    if (read_info.version < 5) { /* pre-version 15.0? */
  272.       if (LogFlag == 2) /* logmap=old changed again in format 5! */
  273.      LogFlag = -1;
  274.       if (decomp[0] > 0 && decomp[1] > 0)
  275.      bailout = decomp[1];
  276.       }
  277.    if(potflag) /* in version 15.x and 16.x logmap didn't work with pot */
  278.       if(read_info.version == 6 || read_info.version == 7)
  279.          LogFlag = 0;
  280.    set_trig_pointers(-1);
  281.  
  282.    if (display3d)            /* PB - a klooge till the meaning of */
  283.       usr_floatflag = oldfloatflag; /*    floatflag in line3d is clarified */
  284.  
  285.    if (overlay3d) {
  286.       initmode = adapter;       /* use previous adapter mode for overlays */
  287.       if (filexdots > xdots || fileydots > ydots) {
  288.      static char far msg[]={"Can't overlay with a larger image"};
  289.      stopmsg(0,msg);
  290.      EXIT_OVLY;
  291.      initmode = -1;
  292.      return(-1);
  293.      }
  294.       }
  295.    else {
  296.       int olddisplay3d,oldfloatflag,i;
  297.       olddisplay3d = display3d;
  298.       oldfloatflag = floatflag;
  299.       display3d = loaded3d;      /* for <tab> display during next */
  300.       floatflag = usr_floatflag; /* ditto */
  301.       i = get_video_mode(&read_info);
  302.       display3d = olddisplay3d;
  303.       floatflag = oldfloatflag;
  304.       if (i) {
  305.      EXIT_OVLY;
  306.      initmode = -1;
  307.      return(-1);
  308.      }
  309.       }
  310.  
  311.    if (display3d) {
  312.       calc_status = 0;
  313.       fractype = PLASMA;
  314.       curfractalspecific = &fractalspecific[PLASMA];
  315.       param[0] = 0;
  316.       if (!initbatch)
  317.      if (get_3d_params() < 0) {
  318.         EXIT_OVLY;
  319.         initmode = -1;
  320.         return(-1);
  321.         }
  322.       }
  323.  
  324.    showfile = 0;           /* trigger the file load */
  325.  
  326.    EXIT_OVLY;
  327.    return(0);
  328. }
  329.  
  330.  
  331. static int find_fractal_info(gif_file,info)
  332. char *gif_file;
  333. struct fractal_info *info;
  334. {
  335.    unsigned char gifstart[18];
  336.    char temp1[81];
  337.    int scan_extend, block_type, block_len, data_len;
  338.    int fractinf_len;
  339.    int hdr_offset;
  340.  
  341.    if((fp = fopen(gif_file,"rb"))==NULL)
  342.       return(-1);
  343.  
  344.    fread(gifstart,18,1,fp);
  345.    if (strncmp(gifstart,"GIF",3)!=0) { /* not GIF, maybe old .tga? */
  346.       if(fread(info,sizeof(struct fractal_info),1,fp)==1 &&
  347.          strncmp(info->info_id,"Fractal",8)==0) {
  348.      filetype = 1; /* Targa 16 */
  349.      fileydots = *(int *)&gifstart[O_VSIZE];
  350.      filexdots = *(int *)&gifstart[O_HSIZE];
  351.      filecolors = info->colors;
  352.      fileaspectratio = SCREENASPECT;
  353.      if(fileydots == info->ydots && filexdots == info->xdots) {
  354.         fclose(fp);
  355.         return(0);
  356.         }
  357.      }
  358.       fclose(fp);
  359.       return(-1);
  360.       }
  361.  
  362.    filetype = 0; /* GIF */
  363.    filexdots = gifstart[7]*256+gifstart[6];
  364.    fileydots = gifstart[9]*256+gifstart[8];
  365.    filecolors = 2 << (gifstart[10] & 7);
  366.    fileaspectratio = 0; /* unknown */
  367.    if (gifstart[12]) { /* calc reasonably close value from gif header */
  368.       fileaspectratio = (64.0 / ((double)(gifstart[12]) + 15.0))
  369.               * (double)fileydots / (double)filexdots;
  370.       if ( fileaspectratio > SCREENASPECT-0.03
  371.     && fileaspectratio < SCREENASPECT+0.03)
  372.      fileaspectratio = SCREENASPECT;
  373.       }
  374.    else
  375.       if (fileydots * 4 == filexdots * 3) /* assume the common square pixels */
  376.      fileaspectratio = SCREENASPECT;
  377.  
  378.    if (resume_info != NULL) { /* free the prior area if there is one */
  379.       farmemfree(resume_info);
  380.       resume_info = NULL;
  381.       }
  382.    if (rangeslen) { /* free prior ranges */
  383.       farmemfree((char far *)ranges);
  384.       rangeslen = 0;
  385.       }
  386.  
  387.    /* Format of .gif extension blocks is:
  388.       1 byte    '!', extension block identifier
  389.       1 byte    extension block number, 255
  390.       1 byte    length of id, 11
  391.      11 bytes   alpha id, "fractintnnn" with fractint, nnn is secondary id
  392.        n * {
  393.       1 byte    length of block info in bytes
  394.       x bytes   block info
  395.        }
  396.       1 byte    0, extension terminator
  397.       To scan extension blocks, we first look in file at length of fractal_info
  398.       (the main extension block) from end of file, looking for a literal known
  399.       to be at start of our block info.  Then we scan forward a bit, in case
  400.       the file is from an earlier fractint vsn with shorter fractal_info.
  401.       If fractal_info is found and is from vsn>=14, it includes the total length
  402.       of all extension blocks; we then scan them all first to last to load
  403.       any optional ones which are present.
  404.       Defined extension blocks:
  405.     fractint001    header, always present
  406.     fractint002    resume info for interrupted resumable image
  407.     fractint003    additional formula type info
  408.     fractint004    ranges info
  409.    */
  410.  
  411.    memset(info,0,sizeof(FRACTAL_INFO));
  412.    fractinf_len = sizeof(FRACTAL_INFO) + (sizeof(FRACTAL_INFO)+254)/255;
  413.    fseek(fp,(long)(-1-fractinf_len),SEEK_END);
  414.    fread(info,1,sizeof(FRACTAL_INFO),fp);
  415.    if (strcmp(INFO_ID,info->info_id) == 0)
  416.       hdr_offset = -1-fractinf_len;
  417.    else {
  418.       /* didn't work 1st try, maybe an older vsn, maybe junk at eof, scan: */
  419.       int offset,i;
  420.       char tmpbuf[110];
  421.       hdr_offset = 0;
  422.       offset = 80; /* don't even check last 80 bytes of file for id */
  423.       while (offset < fractinf_len+513) { /* allow 512 garbage at eof */
  424.      offset += 100; /* go back 100 bytes at a time */
  425.      fseek(fp,(long)(0-offset),SEEK_END);
  426.      fread(tmpbuf,1,110,fp); /* read 10 extra for string compare */
  427.      for (i = 0; i < 100; ++i)
  428.         if (!strcmp(INFO_ID,&tmpbuf[i])) { /* found header? */
  429.            strcpy(info->info_id,INFO_ID);
  430.            fseek(fp,(long)(hdr_offset=i-offset),SEEK_END);
  431.            fread(info,1,sizeof(FRACTAL_INFO),fp);
  432.            offset = 10000; /* force exit from outer loop */
  433.            break;
  434.            }
  435.      }
  436.       }
  437.  
  438.    if (hdr_offset) { /* we found INFO_ID */
  439.  
  440.       if (info->version >= 4) {
  441.      /* first reload main extension block, reasons:
  442.           might be over 255 chars, and thus earlier load might be bad
  443.           find exact endpoint, so scan back to start of ext blks works
  444.         */
  445.      fseek(fp,(long)(hdr_offset-15),SEEK_END);
  446.      scan_extend = 1;
  447.      while (scan_extend) {
  448.         if (fgetc(fp) != '!' /* if not what we expect just give up */
  449.           || fread(temp1,1,13,fp) != 13
  450.           || strncmp(&temp1[2],"fractint",8))
  451.            break;
  452.         temp1[13] = 0;
  453.         block_type = atoi(&temp1[10]); /* e.g. "fractint002" */
  454.         switch (block_type) {
  455.            case 1: /* "fractint001", the main extension block */
  456.           if (scan_extend == 2) { /* we've been here before, done now */
  457.              scan_extend = 0;
  458.              break;
  459.              }
  460.           load_ext_blk((char far *)info,sizeof(FRACTAL_INFO));
  461.           scan_extend = 2;
  462.           /* now we know total extension len, back up to first block */
  463.           fseek(fp,0L-info->tot_extend_len,SEEK_CUR);
  464.           break;
  465.            case 2: /* resume info */
  466.           skip_ext_blk(&block_len,&data_len); /* once to get lengths */
  467.           if ((resume_info = farmemalloc((long)data_len)) == NULL)
  468.              info->calc_status = 3; /* not resumable after all */
  469.           else {
  470.              fseek(fp,(long)(0-block_len),SEEK_CUR);
  471.              load_ext_blk(resume_info,data_len);
  472.              resume_len = data_len;
  473.              }
  474.           break;
  475.            case 3: /* formula info */
  476.           {
  477.           char *nameptr;
  478.           char tmpname[40];
  479.           load_ext_blk(tmpname,40);
  480.           switch (info->fractal_type) {
  481.              case LSYSTEM:
  482.             nameptr = LName;
  483.             break;
  484.              case IFS:
  485.              case IFS3D:
  486.             nameptr = IFSName;
  487.             break;
  488.              default:
  489.             nameptr = FormName;
  490.             break;
  491.              }
  492.           tmpname[ITEMNAMELEN] = 0;
  493.           strcpy(nameptr,tmpname);
  494.           /* perhaps in future add more here, check block_len for
  495.              backward compatibility */
  496.           }
  497.           break;
  498.            case 4: /* ranges info */
  499.           skip_ext_blk(&block_len,&data_len); /* once to get lengths */
  500.           if ((ranges = (int far *)farmemalloc((long)data_len))) {
  501.              fseek(fp,(long)(0-block_len),SEEK_CUR);
  502.              load_ext_blk((char far *)ranges,data_len);
  503.              rangeslen = data_len/2;
  504.              }
  505.           break;
  506.            default:
  507.           skip_ext_blk(&block_len,&data_len);
  508.            }
  509.         }
  510.      }
  511.  
  512.       fclose(fp);
  513.       fileaspectratio = SCREENASPECT; /* if not >= v15, this is correct */
  514.       return(0);
  515.       }
  516.  
  517.    strcpy(info->info_id, "GIFFILE");
  518.    info->iterations = 150;
  519.    info->fractal_type = PLASMA;
  520.    info->xmin = -1;
  521.    info->xmax = 1;
  522.    info->ymin = -1;
  523.    info->ymax = 1;
  524.    info->x3rd = -1;
  525.    info->y3rd = -1;
  526.    info->creal = 0;
  527.    info->cimag = 0;
  528.    info->videomodeax=255;
  529.    info->videomodebx=255;
  530.    info->videomodecx=255;
  531.    info->videomodedx=255;
  532.    info->dotmode = 0;
  533.    info->xdots = filexdots;
  534.    info->ydots = fileydots;
  535.    info->colors = filecolors;
  536.    info->version = 0; /* this forces lots more init at calling end too */
  537.  
  538.    /* zero means we won */
  539.    fclose(fp);
  540.    return(0);
  541. }
  542.  
  543. static void load_ext_blk(char far *loadptr,int loadlen)
  544. {
  545.    int len;
  546.    while ((len = fgetc(fp)) > 0) {
  547.       while (--len >= 0) {
  548.      if (--loadlen >= 0)
  549.         *(loadptr++) = fgetc(fp);
  550.      else
  551.         fgetc(fp); /* discard excess characters */
  552.      }
  553.       }
  554. }
  555.  
  556. static void skip_ext_blk(int *block_len, int *data_len)
  557. {
  558.    int len;
  559.    *data_len = 0;
  560.    *block_len = 1;
  561.    while ((len = fgetc(fp)) > 0) {
  562.       fseek(fp,(long)len,SEEK_CUR);
  563.       *data_len += len;
  564.       *block_len += len + 1;
  565.       }
  566. }
  567.  
  568.  
  569. /* switch obsolete fractal types to new generalizations */
  570. static void backwardscompat(struct fractal_info *info)
  571. {
  572.    switch(fractype) {
  573.       case LAMBDASINE:
  574.      fractype = LAMBDATRIGFP;
  575.      trigndx[0] = SIN;
  576.      break;
  577.       case LAMBDACOS    :
  578.      fractype = LAMBDATRIGFP;
  579.      trigndx[0] = COS;
  580.      break;
  581.       case LAMBDAEXP    :
  582.      fractype = LAMBDATRIGFP;
  583.      trigndx[0] = EXP;
  584.      break;
  585.       case MANDELSINE    :
  586.      fractype = MANDELTRIGFP;
  587.      trigndx[0] = SIN;
  588.      break;
  589.       case MANDELCOS    :
  590.      fractype = MANDELTRIGFP;
  591.      trigndx[0] = COS;
  592.      break;
  593.       case MANDELEXP    :
  594.      fractype = MANDELTRIGFP;
  595.      trigndx[0] = EXP;
  596.      break;
  597.       case MANDELSINH    :
  598.      fractype = MANDELTRIGFP;
  599.      trigndx[0] = SINH;
  600.      break;
  601.       case LAMBDASINH    :
  602.      fractype = LAMBDATRIGFP;
  603.      trigndx[0] = SINH;
  604.      break;
  605.       case MANDELCOSH    :
  606.      fractype = MANDELTRIGFP;
  607.      trigndx[0] = COSH;
  608.      break;
  609.       case LAMBDACOSH    :
  610.      fractype = LAMBDATRIGFP;
  611.      trigndx[0] = COSH;
  612.      break;
  613.       case LMANDELSINE    :
  614.      fractype = MANDELTRIG;
  615.      trigndx[0] = SIN;
  616.      break;
  617.       case LLAMBDASINE    :
  618.      fractype = LAMBDATRIG;
  619.      trigndx[0] = SIN;
  620.      break;
  621.       case LMANDELCOS    :
  622.      fractype = MANDELTRIG;
  623.      trigndx[0] = COS;
  624.      break;
  625.       case LLAMBDACOS    :
  626.      fractype = LAMBDATRIG;
  627.      trigndx[0] = COS;
  628.      break;
  629.       case LMANDELSINH    :
  630.      fractype = MANDELTRIG;
  631.      trigndx[0] = SINH;
  632.      break;
  633.       case LLAMBDASINH    :
  634.      fractype = LAMBDATRIG;
  635.      trigndx[0] = SINH;
  636.      break;
  637.       case LMANDELCOSH    :
  638.      fractype = MANDELTRIG;
  639.      trigndx[0] = COSH;
  640.      break;
  641.       case LLAMBDACOSH    :
  642.      fractype = LAMBDATRIG;
  643.      trigndx[0] = COSH;
  644.      break;
  645.       case LMANDELEXP    :
  646.      fractype = MANDELTRIG;
  647.      trigndx[0] = EXP;
  648.      break;
  649.       case LLAMBDAEXP    :
  650.      fractype = LAMBDATRIG;
  651.      trigndx[0] = EXP;
  652.      break;
  653.       case DEMM     :
  654.      fractype = MANDELFP;
  655.      usr_distest = (info->ydots - 1) * 2;
  656.      break;
  657.       case DEMJ     :
  658.      fractype = JULIAFP;
  659.      usr_distest = (info->ydots - 1) * 2;
  660.      break;
  661.       case MANDELLAMBDA :
  662.      useinitorbit = 2;
  663.      break;
  664.       }
  665.    curfractalspecific = &fractalspecific[fractype];
  666. }
  667.